package ltd.dujiabao.capability.common.utils;

import java.util.Map;


/**
 * @author : DuJiabao
 * @Project : ddd-capability
 * @Time : 2024/4/13 18:55
 * @Desc :
 */
public class MapUtils {
    public static Object deepGet(Map<String, Object> map, String keys) {
        String[] split = keys.split("\\.");
        for (int i = 0; i < split.length - 1; i++) {
            String s = split[i];
            if (map == null || !map.containsKey(s)) {
                return null;
            }
            map = (Map<String, Object>) map.get(s);
        }
        return map.get(split[split.length - 1]);
    }
}
